﻿#ifndef XPUSHBUTTONFOURARITHMETIC_H
#define XPUSHBUTTONFOURARITHMETIC_H

#include <QWidget>
#include <QPushButton>
#include <QPainter>
#include <QMouseEvent>
#include <QApplication>

#include "xnamespace.h"
#include "xregister.h"

QT_BEGIN_NAMESPACE

class XPushButtonFourArithmeticPrivate;
class XPushButtonFourArithmetic : public QObject
{
    Q_OBJECT

    Q_PROPERTY(XRegister *resultRegister READ getResultRegister WRITE setResultRegister)

    Q_PROPERTY(FourArithmeticType arithmeticType READ getArithmeticType WRITE setArithmeticType)

    Q_PROPERTY(NumberType leftOperandNumberType READ getLeftOperandNumberType WRITE setLeftOperandNumberType)
    Q_PROPERTY(NumberType rightOperandNumberType READ getRightOperandNumberType WRITE setRightOperandNumberType)
    Q_PROPERTY(XRegister *leftOperandRegister READ getLeftOperandRegister WRITE setLeftOperandRegister)
    Q_PROPERTY(XRegister *rightOperandRegister READ getRightOperandRegister WRITE setRightOperandRegister)
    Q_PROPERTY(double leftOperandConstant READ getLeftOperandConstant WRITE setLeftOperandConstant)
    Q_PROPERTY(double rightOperandConstant READ getRightOperandConstant WRITE setRightOperandConstant)

    Q_PROPERTY(bool upperLimitEnable READ getUpperLimitEnable WRITE setUpperLimitEnable)
    Q_PROPERTY(bool lowerLimitEnable READ getLowerLimitEnable WRITE setLowerLimitEnable)
    Q_PROPERTY(NumberType upperLimitType READ getUpperLimitType WRITE setUpperLimitType)
    Q_PROPERTY(NumberType lowerLimitType READ getLowerLimitType WRITE setLowerLimitType)
    Q_PROPERTY(XRegister *upperLimitRegister READ getUpperLimitRegister WRITE setUpperLimitRegister)
    Q_PROPERTY(XRegister *lowerLimitRegister READ getLowerLimitRegister WRITE setLowerLimitRegister)
    Q_PROPERTY(int upperLimitConstant READ getUpperLimitConstant WRITE setUpperLimitConstant)
    Q_PROPERTY(int lowerLimitConstant READ getLowerLimitConstant WRITE setLowerLimitConstant)

public:
    explicit XPushButtonFourArithmetic(QWidget *parent = nullptr);
    ~XPushButtonFourArithmetic();

    /* Property Interface */
    XRegister* getResultRegister() const;
    void setResultRegister(XRegister *resultRegis);

    FourArithmeticType getArithmeticType() const;
    void setArithmeticType(FourArithmeticType);

    NumberType getLeftOperandNumberType() const;
    void setLeftOperandNumberType(NumberType);

    NumberType getRightOperandNumberType() const;
    void setRightOperandNumberType(NumberType);

    XRegister* getLeftOperandRegister() const;
    void setLeftOperandRegister(XRegister *leftOperandRegis);

    XRegister* getRightOperandRegister() const;
    void setRightOperandRegister(XRegister *rightOperandRegis);

    double getLeftOperandConstant() const;
    void setLeftOperandConstant(double value);

    double getRightOperandConstant() const;
    void setRightOperandConstant(double value);

    bool getUpperLimitEnable() const;
    void setUpperLimitEnable(bool enable);

    bool getLowerLimitEnable() const;
    void setLowerLimitEnable(bool enable);

    NumberType getUpperLimitType() const;
    void setUpperLimitType(NumberType);

    NumberType getLowerLimitType() const;
    void setLowerLimitType(NumberType);

    XRegister* getUpperLimitRegister() const;
    void setUpperLimitRegister(XRegister *upperLimitRegis);

    XRegister* getLowerLimitRegister() const;
    void setLowerLimitRegister(XRegister *lowerLimitRegis);

    int getUpperLimitConstant() const;
    void setUpperLimitConstant(int value);

    int getLowerLimitConstant() const;
    void setLowerLimitConstant(int value);

private:
    Q_DISABLE_COPY(XPushButtonFourArithmetic)
    XPushButtonFourArithmeticPrivate *xPushButtonFourArithmeticP = nullptr;

};

QT_END_NAMESPACE

#endif // XPUSHBUTTONFOURARITHMETIC_H
